public class Random {
    public static void main(String[] args) {
        int n = 999; // 假设n为999，可以根据实际情况修改
        findNarcissisticNumbers(n);
    }

    private static void findNarcissisticNumbers(int max) {
        for (int i = 100; i <= max; i++) {
            if (isNarcissistic(i)) {
                System.out.println(i);
            }
        }
    }

    private static boolean isNarcissistic(int number) {
        int originalNumber, remainder, result = 0;
        originalNumber = number;

        while (originalNumber != 0) {
            remainder = originalNumber % 10;
            result += Math.pow(remainder, 3);
            originalNumber /= 10;
        }

        return result == number;
    }
}